import react, { useEffect } from 'react';
import * as echarts from 'echarts';
export default function ZHifu() {
  useEffect(() => {
    const chartDom = document.getElementById('main1');
    const myChart = echarts.init(chartDom);

    const option = {
      xAxis: {
        type: 'category',
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
      },
      yAxis: {
        type: 'value',
      },
      series: [
        {
          data: [5,6,7,8,5,6,1],
          type: 'bar',
        },
      ],
    };
    option && myChart.setOption(option);
    window.onresize = function () {
      myChart.resize();
    };
  }, []);

  return (
    <div style={{ textAlign: 'center', height: '100%', width: '100%' }}>
      <div id="main1" style={{ height: '100%', width: '100%' }}></div>
    </div>
  );
}
